-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic error cdi; COUNTRY=jordan #1259
Conversation
Build succeeded and deployed at https://prism-1259.surge.sh |
@wadhwamatic I'm not seeing the error where "subsequent requests are not rendering when data is available even though the response is the expected geojson object". Can you clarify? Merged in range update PR to this PR. |
@lowriech - what I meant is:
|
Can you send the environment you're using to look at this? That's not what I see, I have updates as usual after the error. @wadhwamatic |
@lowriech - I assigned two issues to @paololucchino to 1) modify the error message text and 2) to create an endpoint for available dates before a CDI layer is loaded. What we have so far works, but is less than ideal since a user has no idea what dates are going to be valid. I'm wondering for now if we should just hack this a bit and assume the latest available CDI will be today - 1 month. @ericboucher, what do you think about this approach given that we don't have a way to know available dates for CDI as of now. If this sounds good, maybe @gislawill can take on implementation. |
@wadhwamatic can you share a case where the data is not available for CDI? |
@ericboucher - Jordan CDI on 1-June-2024 returns a date error. https://prism-1259.surge.sh/?hazardLayerIds=cdi_v1&date=2024-06-01 |
@wadhwamatic, @lowriech, @ericboucher — I've made an attempt to improve this and would appreciate your thoughts. The latest available date for analysis currently is May 1st (exactly two months ago). To hack this before WFP-VAM/hip-service#12, I added an "expectedDataLagDays" option to the composite layer that shifts the default date. Currently, the default date is the latest available date that that's returned from the server as SPI's latest available date. |
frontend/src/utils/useDefaultDate.ts
Outdated
// TODO - use getPossibleDatesForLayer | ||
// Update on 2024-07-01: getPossibleDatesForLayer would give us the first possible layer date, we want the _last_ possible date. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note here, I don't think this to do is still relevant. Either that or we should refactor how composite layers are handled in getPossibleDatesForLayer
@gislawill - thanks for diving into this. The logic you described below all sounds good to me for our temporary solution until hip-service handles date availability.
Ideally, we would also use the date lag definition to hide unavailable dates in the timeline. In this case, we'd want to show available date ticks that are more than 55 days in the past for the CDI layer. But if that is going to add a lot of extra work, we can skip it for now. |
@wadhwamatic sure thing, I added that update here: #1295 I separated it from this PR because I'm not confident the improvement in user experience is worth the risk of bugs + complications to maintainance we'd be introducing. If https://github.com/WFP-VAM/hip-service/issues/12 is coming soon and this UX improvement, I believe that solution (in #1295) is functional and addresses the issue. It's just pretty unintuitive code so I wouldn't want it in the codebase for now |
d902875
to
df5a171
Compare
Heads up, after discussing with Amit, I pulled all of my commits from this branch to #1295 That allows it to be used for demos without adding this date logic complication to the repo |
This should be ready for review again @wadhwamatic and @ericboucher |
ok to merge into the other PR but I would prefer to remove the |
* Updating to use month range * Fix date propagation in CDI * Update composite_data.ts * Use getFormattedDate * Update composite_data.ts * Update composite_data.ts * add mozambique cdi for testing * Update index.tsx * Dynamic error cdi; COUNTRY=jordan (#1259) * Updating to use local hip service * no console * Clean up * Clean up readme --------- Co-authored-by: Christopher J Lowrie <[email protected]> Co-authored-by: ericboucher <[email protected]> Co-authored-by: Amit Wadhwa <[email protected]> Co-authored-by: Will Gislason <[email protected]> * Removing local hip service env var * Error handling fixes and end date support form the lyer * Initial support for seasonal CDI * Remove console log, update configs for tests to pass * Appease eslint * Fixing seasonal fetch - using first of next season as 'end' * Support for validity areas in composite layers * Reducing date deduping * Clean up * refactor datesAreEqualWithoutTime * Fix datesAreEqualWithoutTime * Adding 'season' validity * Skip the tests * Fixing query date for seasonal range * Updating CDI config in cambodia and mozambique * Update tests * undo log update * update mozambique CDI for testing * Update composite monthly date range * Handling overlap selection for dates without overlapping validity * fix test * rename scale to period * Updates to date picking * Allow composite layers with validity or without * Update the query display matching to be more flexible * Updating event handlers in time selection * Test fic * Better test fix * Break out visible layer dates and selectable layer dates * don't fetch CDI for invalid dates * fix tests * Fixing availability date indicator * Ensuring messaging fires * fix lint * Reuse clickDate for draggable item * Update index.tsx * Update datasetStateSlice.ts * Update index.tsx * Adding back no date overlapping handling * Ensuring that date selection warning is displayed when the date jumps to valid date * Remove check intersection, leveraging logic in layer-utils * using in datesAreEqualWithoutTime in findDateIndex * Update layers-utils.tsx * Only remove non-boundary layers * Handling AA dates with fewer limitations * Add comment to code * Fix extra visible dates for AA * Update logic in useLayer's useEffect to ensure we don't exit early * Fix AA parseFloat * Ensuring group is writable in formatLayersCategories * fixing eslint --------- Co-authored-by: Christopher J Lowrie <[email protected]> Co-authored-by: ericboucher <[email protected]> Co-authored-by: Amit Wadhwa <[email protected]> Co-authored-by: Chris Lowrie <[email protected]>
@wadhwamatic check it out, pretty simple updates to parameterize a local hip service and to utilize a detail error message